package chpt3;

import java.util.Arrays;
import java.util.Scanner;

class Rectangle{
	private int width;
	private int length;

public Rectangle(int width ,int length) {
	this.width = width;
	this.length = length;	
}


@Override
public String toString() {
	return "Rectangle [width=" + width + ", length=" + length + "]";
}


public int getWidth() {
	return width;
}


public void setWidth(int width) {
	this.width = width;
}


public int getLength() {
	return length;
}


public void setLength(int length) {
	this.length = length;
}


public int getPerimeter(int width , int length){
	
	return (int)(2*(width+length));
}

public int getArea(int width , int length){
	
	return (int)(width*length);
}

}
class Circle{
	
	private int radius;

public Circle(int radius){
	this.radius = radius;
}



@Override
public String toString() {
	return "Circle [radius=" + radius + "]";
}



public int getRadius() {
	return radius;
}



public void setRadius(int radius) {
	this.radius = radius;
}



public int getPerimeter(int radius){
	
	return (int) (2*Math.PI*radius);
}

public int getArea(int radius){
	
	return (int) (Math.PI*radius*radius);
	
}

}
public class MM3{
public static void main(String[] args) {
	Scanner in = new Scanner(System.in);
	//int n =Integer.parseInt(in.nextLine());
	Rectangle[] Rectangles = new Rectangle[2];
	Circle[] Circles = new Circle[2];
	int sum1 = 0;
	int sum2 = 0;
	int sum3 = 0;
	int sum4 = 0;
	for(int i = 0;i< 2;i++){
		Rectangles[i] = new Rectangle(in.nextInt(),in.nextInt());
		sum1+=Rectangles[i].getPerimeter(Rectangles[i].getWidth(),Rectangles[i].getLength());
		sum2+=Rectangles[i].getArea(Rectangles[i].getWidth(),Rectangles[i].getLength());
	}
	for(int j = 0;j< 2;j++){
		Circles[j] = new Circle(in.nextInt());
		sum3+=Circles[j].getPerimeter(Circles[j].getRadius());
		sum4+=Circles[j].getArea(Circles[j].getRadius());		
	}
	System.out.println(sum1+sum3);
	System.out.println(sum2+sum4);
	System.out.println(Arrays.deepToString(Rectangles));
    System.out.println(Arrays.deepToString(Circles)); 
}
}




